<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
<h:form id="formConProd">

	<div class="ym-grid">
		<p:panel header="#{message.label_produto}" style="margin-left:15px;">

			<div class="ym-grid">
				<div class="ym-g20 ym-gl">
					<div class="ym-gbox">
						<h:outputText value="#{message.label_codigo}" />
					</div>
					<div class="ym-gbox">
						<p:inputText value="#{consultaPanel.campo1}" size="10">
							<p:ajax event="keyup" update="listaProTable"
								listener="#{consultaPanel.atualizaProduto}" global="false" />
						</p:inputText>
					</div>
				</div>
				<div class="ym-g20 ym-gl">
					<div class="ym-gbox">
						<h:outputText value="#{message.label_descri}" />
					</div>
					<div class="ym-gbox">
						<p:inputText value="#{consultaPanel.campo2}">
							<p:ajax event="keyup" update="listaProTable"
								listener="#{consultaPanel.atualizaProduto}" global="false" />
						</p:inputText>
					</div>
				</div>

			</div>
		</p:panel>

		<p:outputPanel style="margin-top:10px;">

			<p:dataTable id="listaProTable" var="prod"
				value="#{consultaPanel.prodModel}" rowKey="#{prod.codigo}"
				widgetVar="listaProdTable" emptyMessage="#{message.table_empty}"
				paginator="true" rows="10"
				paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
				rowsPerPageTemplate="5,10,15" selectionMode="single"
				selection="#{orcamentoTela.produto}" style="margin-left:15px;">
				<p:ajax event="rowSelect"
					update=":formCO:idProdCad,:formCO:idDesCad,:formCO:idUmCad,:formCO:idMarCad"
					oncomplete="dlgConProd.hide()"
					process="@this,:formCO:idProdCad,:formCO:idDesCad,:formCO:idUmCad"
					global="false" />
				<p:column>
					<f:facet name="header">
						<h:outputText value="#{message.label_codigo}" />
					</f:facet>
					<h:outputText value="#{prod.codigo}" />
				</p:column>
				<p:column>
					<f:facet name="header">
						<h:outputText value="#{message.label_marca}" />
					</f:facet>
					<h:outputText value="#{prod.marca}" />
				</p:column>
				<p:column>
					<f:facet name="header">
						<h:outputText value="#{message.label_descricao}" />
					</f:facet>
					<h:outputText value="#{prod.descricao}" />
				</p:column>
				<p:column>
					<f:facet name="header">
						<h:outputText value="#{message.label_um}" />
					</f:facet>
					<h:outputText value="#{prod.unidadeMedida}" />
				</p:column>

			</p:dataTable>
		</p:outputPanel>
	</div>
</h:form>
</html>